<?php
//echo '<pre>';
//print_r($cart);
//echo '</pre>';
?>
<section class="itq-wrapper">

    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 style="color: red">Giỏ Hàng</h3>
            </div>
            <!-- /.panel-heading -->
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>Tên Sản Phẩm</th>
                            <th>ảnh</th>
                            <th>Số lượng</th>
                            <th>Đơn giá</th>
                        </tr>
                        </thead>
                        <tbody>
                        <form action="index.php?r=home/buyproduct" method="post">
                            <?php
                            if(isset($cart)){
                                foreach($cart as $key=>$value){
                                    if(is_array($value)){
                                        ?>
<!--                                        <tr>-->
<!--                                            <td><input type="hidden"  name="--><?php //echo $value['id'];?><!--[id]" value="--><?php //echo $value['id'];?><!--"> --><?php //echo $value['id'];?><!-- </td>-->
<!--                                            <td><input type="hidden"  name="--><?php //echo $value['id'];?><!--[title]" value="--><?php //echo $value['title'];?><!--">--><?php //echo $value['title'];?><!--</td>-->
<!--                                            <td><input  type="hidden" name="--><?php //echo $value['id'];?><!--[images]" value="--><?php //echo $value['images'];?><!--"><img src="--><?php //echo $value['images'];?><!--"> </td>-->
<!--                                            <td><input  type="text"   name="--><?php //echo $value['id'];?><!--[qty]" value="--><?php //echo $value['qty'];?><!--" class="cart-qty"></td>-->
<!--                                            <td><input  type="hidden" name="--><?php //echo $value['id'];?><!--[cost]"value="--><?php //echo $value['cost'];?><!--"> --><?php //echo $value['cost'];?><!--</td>-->
<!--                                            <td><input  type="hidden" name="--><?php //echo $value['id'];?><!--[sumcost]"value="--><?php //echo $value['sumcost'];?><!--"> --><?php //echo $value['sumcost'];?><!--</td>-->
<!--                                        </tr>-->
                                        <tr>
                                            <td><?php echo $value['id'];?> </td>
                                            <td><?php echo $value['name'];?></td>
                                            <td><img style="width: 300; height: 200px;" src="<?php echo $value['images'];?>"> </td>
                                            <td><input  type="text"   name="<?php echo $value['id'];?>[qty]" value="<?php echo $value['qty'];?>" class="cart-qty"></td>
                                            <td><?php echo $value['cost'];?></td>
                                            <td><?php echo $value['sumcost'];?></td>
                                        </tr>
                                    <?php
                                    }
                                }
                            }
                            ?>
                            <tr>
                                <td><a href="index.php?r=home/index" class="btn btn-default"> Mua Tiếp</a> </td>
                            <td>Tạm Tính:<input type="hidden" value="<?php echo $cart['count']?>" name="count"><?php echo $cart['count']?> </td>
                                <td><input class="btn btn-default" type="submit"  value="cập nhật"></td>
                                <td><a href="index.php?r=home/pay" class="btn btn-default"> Đặt Hàng </a> </td>
                            </tr>
                        </form>

                    </table>
                </div>
            </div>
        </div>
    </div>
</section>
<section class="clear"></section>